#include <iostream>

using namespace std;
using ll=long long;


ll _gcd(ll x,ll y)
{
	while(y)
	{
		ll t=x%y;
		x=y;
		y=t;
	}
	return x;
}
int main()
{
	ll n,x;
	cin>>n>>x;
	
	for(int i=0;i<n;i++)
	{
		ll t;
		cin>>t;
		if(t>=x)
		{
			x+=_gcd(t,x);
		}	
		else{
			x+=t;
		}
	}
	cout<<x<<endl;
	return 0;
}
